package com.u.finance.loans.mq;

import com.u.finance.loans.entity.Loans;
import com.u.finance.loans.service.ILoansService;
import jakarta.annotation.Resource;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @program: u-finance
 * @description: 下方账户的消费类
 * @author: Alex Wu
 * @createDate: 2025-03-28 17:03
 **/
@RocketMQMessageListener(topic = "payout-topic",consumerGroup = "payout-topic-group")
public class PayOutLoansConsumer {

    @Autowired
    private ILoansService loansService;


    public void onMessage(Loans loans){
        loansService.payOut(loans.getId());
    }

    private Integer fetchAIApprove(Loans loans){
        return 1;
    }
}
